{template "header.html"}


<div class="row">
    <div class="col-md-12">
        <div class="admin-usermenu">
            {loop $admin.usermenu $t}
            <a class="btn {if $t.color && $t.color!='default'}{$t.color}{else}btn-default{/if}" href="{$t.url}"> {$t.name} </a>
            {/loop}
        </div>
    </div>
</div>

<div class="row">



    <div class="col-md-6 col-sm-6">

        <div class="portlet light bordered myportlet">
            <div class="portlet-title tabbable-line">
                <div class="caption">
                    <i class="fa fa-bar-chart"></i>
                    <span class="caption-subject"> {dr_lang('数据统计')} </span>
                </div>
            </div>
            <div class="portlet-body">
                <?php


		$mtotal = [];
		$module = $ci->get_cache('module-'.SITE_ID.'-content');
                if ($module) {
                foreach ($module as $dir => $t) {
                // 判断权限
                $mtotal[$dir] = [
                'name' => dr_lang($t['name']),
                'today' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/home/index'),
                'all' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/home/index'),
                'verify' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/verify/index', $dir.'/verify/index'),
                'recycle' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/recycle/index'),
                'timing' => \Phpcmf\Service::M('auth')->_menu_link_url($dir.'/home/index', $dir.'/time/index'),
                ];
                }
                }
                ?>
                <div class="table-scrollable">
                    <table class="table table-mtotal table-nomargin table-bordered table-striped table-bordered table-advance">
                        <thead>
                        <tr>
                            <th>{dr_lang('模块')}</th>
                            <th>{dr_lang('总数据')}</th>
                            <th>{dr_lang('今日')}</th>
                            <th>{dr_lang('回收站')}</th>
                        </tr>
                        </thead>
                        <tbody>
                        {loop $mtotal $dir $t}
                        <tr>
                            <td>{$t.name}</td>
                            <td><a class="drlabel drlabel-success" href="{$t.all}" id="{$dir}_all"><img src="{THEME_PATH}assets/images/mloading.gif"></a></td>
                            <td><a class="drlabel drlabel-success" href="{$t.today}" id="{$dir}_today"><img src="{THEME_PATH}assets/images/mloading.gif"></a></td>
                            <td><a class="drlabel drlabel-important" href="{$t.recycle}" id="{$dir}_recycle"><img src="{THEME_PATH}assets/images/mloading.gif"></a></td>
                        </tr>
                        <script type="text/javascript">
                            $(function(){
                                $.getScript("{dr_url('api/mtotal')}&dir={$dir}");
                            });
                        </script>
                        {/loop}
                        </tbody>
                    </table>

                </div>
            </div>
        </div>



    </div>


    <div class="col-md-6 col-sm-6">

        <div class="portlet light bordered myportlet ">
            <div class="portlet-title tabbable-line">
                <div class="caption">
                    <i class="fa fa-cloud"></i>
                    <span class="caption-subject"> <a style="color:#666" href="http://www.php7cms.com" target="_blank">{dr_lang('PHP7CMS')}</a> </span>
                </div>
            </div>
            <div class="portlet-body">

                <div class="scroller" data-always-visible="1" data-rail-visible="0">
                    <div class="col-md-9">
                        <ul class="use-info">
                            <li style="height: 35px;">
                                <span>程序版本：</span>
                                <a target="_blank" href="http://www.php7cms.com/">PHP7CMS免费版 v{$cms_version}</a>
                            </li>
                            <li style="height: 35px;">
                                <span>源码仓库：</span>
                                <a target="_blank" href="https://gitee.com/wchunjie/php7cms">https://gitee.com/wchunjie/php7cms</a>
                            </li>

                            <li style="height: 35px;">
                                <span>技术论坛：</span>
                                <a target="_blank" href="http://www.finebug.com/phpcmf">http://www.finebug.com/phpcmf</a>
                            </li>
                            <li style="height: 35px;">
                                <span>QQ群讨论：</span>
                                <a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=58824469df9cacea494e0ebad5e9dc69a2e4aded6b8f37ae28adb3f705c2ee9a">QQ群号 644732788</a>
                            </li>

                        </ul>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>

<script>
    $(function () {
        $.ajax({type: "GET",dataType:"json", url: admin_file+"?s=mall&c=api&m=count_total",
            success: function(json) {
                if (json.code) {
                    $('#dr_member_total').html(json.data.member);
                    $('#dr_goods_total').html(json.data.goods);
                    $('#dr_order_total').html(json.data.order);
                    $('#dr_mall_total').html(json.data.mall);
                }
            },
            error: function(HttpRequest, ajaxOptions, thrownError) {

            }
        });

    });
</script>

{template "footer.html"}